package com.mbyte.easy.event;

import com.mbyte.easy.admin.entity.Draft;
import com.mbyte.easy.support.es.constants.EsConstants;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Component;

/**
 * @program: easy
 * @description:事件发布者
 * @author: lxt
 * @create: 2019-12-31 10:34
 **/
@Component
public class CmsEventPublisher {
    @Autowired
    private ApplicationContext applicationContext;

    /**
     * 发布稿件事件
     * @param draft
     */
    public void publishChangeDraftEvent(Draft draft){
        applicationContext.publishEvent(new ChangeDraftEvent(draft));
    }
}
